package Model1;

import java.io.*;
import java.util.*;

/**
 * 
 */
// 客户端类
class Client {
    public static void main(String[] args) {
        Bird pigeon = new Pigeon();
        pigeon.setSwimBehavior(new UnableSwim());
        pigeon.setFlyBehavior(new FreeFly());

        Bird eagle = new Eagle();
        eagle.setSwimBehavior(new UnableSwim());
        eagle.setFlyBehavior(new FreeFly());

        Bird penguin = new Penguin();
        penguin.setSwimBehavior(new AbleSwim());
        penguin.setFlyBehavior(new UnableFly());

        // 展示鸟类信息并执行它们的行为
        pigeon.display();
        pigeon.performSwim();
        pigeon.performFly();

        eagle.display();
        eagle.performSwim();
        eagle.performFly();

        penguin.display();
        penguin.performSwim();
        penguin.performFly();
    }
}